//
//  WebViewController.m
//  NiuBanJin
//
//  Created by zf on 15/10/12.
//  Copyright © 2015年 zzjr. All rights reserved.
//

#import "WebViewController.h"

@interface WebViewController ()
@property (nonatomic , strong) NSArray *array_text;
@property (nonatomic , strong) NSArray *array_url;
@end

@implementation WebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.array_text = @[@"注册与登录" , @"存入类" , @"转出类" , @"安全类" , @"牛钱包介绍" ,@"关于我们" , @"我的邀请" , @"安全保障" , @"活动中心" , @"加息券获取方法和使用规则" , @"牛板金服务协议" , @"签到规则"];
    self.navigationItem.title = [self.array_text objectAtIndex:self.index];
    
    UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeGestureAction)];
    [self.view addGestureRecognizer:swipeGesture];
    /*
     // h5 页面 相关接口
     public final static String H5_BASE_URL = "http://style.niubangold.com/app/";
     // 加息券获取方法和使用规则
     public final static String COUPON_RULES = H5_BASE_URL + "coupon_rules.html" + "?noheader=1";
     // 安全保障
     public final static String SECURITY_DESCRIPTION = H5_BASE_URL + "security_description.html" + "?noheader=1";
     // 活动中心
     public final static String ACTIVITY = H5_BASE_URL + "activity.html" + "?noheader=1";
     // 牛板金介绍
     public final static String NIU_INTRO = H5_BASE_URL + "niu_intro.html" + "?noheader=1";
     // 关于我们
     public final static String ABOUT = H5_BASE_URL + "about.html" + "?noheader=1";
     // 联系我们
     public final static String CONTACT_HTML = H5_BASE_URL + "contact.html" + "?noheader=1";
     // 《牛板金服务协议》
     public final static String AGREEMENT = H5_BASE_URL + "agreement.html" + "?noheader=1";
     // 注册登录帮助
     public final static String HELP_LOGIN = H5_BASE_URL + "help_login.html" + "?noheader=1";
     // 存入帮助
     public final static String HELP_DEPOSIT = H5_BASE_URL + "help_deposit.html" + "?noheader=1";
     // 转出帮助
     public final static String HELP_WITHDRAW = H5_BASE_URL + "help_withdraw.html" + "?noheader=1";
     // 安全帮助
     public final static String HELP_SECURITY = H5_BASE_URL + "help_security.html" + "?noheader=1";
     // 签到规则
     public final static String SIGN_IN_RULES = H5_BASE_URL + "sign_in_rules.html" + "?noheader=1";
     */
    // 加息券获取方法和使用规则
    NSURL *url_COUPON_RULES = [NSURL URLWithString:@"http://style.niubangold.com/app/coupon_rules.html?noheader=1"];
    // 安全保障
    NSURL *url_SECURITY_DESCRIPTION = [NSURL URLWithString:@"http://style.niubangold.com/app/security_description.html?noheader=1"];
    // 活动中心
    NSURL *url_ACTIVITY = [NSURL URLWithString:@"http://style.niubangold.com/app/activity.html?noheader=1"];
    // 牛板金介绍
     NSURL *url_NIU_INTRO = [NSURL URLWithString:@"http://style.niubangold.com/app/niu_intro.html?noheader=1"];
    // 关于我们
    NSURL *url_ABOUT = [NSURL URLWithString:@"http://style.niubangold.com/app/about.html?noheader=1"];
    // 联系我们
     NSURL *url_CONTACT_HTML = [NSURL URLWithString:@"http://style.niubangold.com/app/contact.html?noheader=1"];
    // 《牛板金服务协议》
    NSURL *url_AGREEMENT = [NSURL URLWithString:@"http://style.niubangold.com/app/agreement.html?noheader=1"];
    // 注册登录帮助
    NSURL *url_HELP_LOGIN = [NSURL URLWithString:@"http://style.niubangold.com/app/help_login.html?noheader=1"];
    // 存入帮助
     NSURL *url_HELP_DEPOSIT = [NSURL URLWithString:@"http://style.niubangold.com/app/help_deposit.html?noheader=1"];
    // 转出帮助
     NSURL *url_HELP_WITHDRAW = [NSURL URLWithString:@"http://style.niubangold.com/app/help_withdraw.html?noheader=1"];
    // 安全帮助
     NSURL *url_HELP_SECURITY = [NSURL URLWithString:@"http://style.niubangold.com/app/help_security.html?noheader=1"];
    // 签到规则
    NSURL *url_SIGN_IN_RULES = [NSURL URLWithString:@"http://style.niubangold.com/app/help_security.html?noheader=1"];
    
    NSDictionary *dic_url = @{@"注册与登录" :url_HELP_LOGIN, @"存入类" : url_HELP_DEPOSIT, @"转出类" : url_HELP_WITHDRAW, @"安全类" : url_HELP_SECURITY , @"牛钱包介绍" :url_NIU_INTRO  ,@"关于我们" : url_ABOUT ,  @"安全保障" : url_SECURITY_DESCRIPTION, @"活动中心" : url_ACTIVITY , @"加息券获取方法和使用规则" : url_COUPON_RULES, @"牛板金服务协议" : url_AGREEMENT, @"签到规则" :url_SIGN_IN_RULES };
    
    
    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - MULTIPLYHEIGHT(30.0))];
    NSURLRequest *request = [NSURLRequest requestWithURL:dic_url[self.navigationItem.title]];
    [webView loadRequest:request];
    [self.view addSubview:webView];

}

#pragma mark -swipeGestureAction
-(void)swipeGestureAction{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
